<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>图书管理系统 - 登录</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background: #f5f5f5;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }
        .login-container {
            width: 350px;
            padding: 30px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 0 15px rgba(0,0,0,0.1);
        }
        .form-group {
            margin-bottom: 20px;
        }
        label {
            display: block;
            margin-bottom: 8px;
            font-weight: bold;
        }
        input[type="text"], input[type="password"] {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }
        button {
            width: 100%;
            padding: 12px;
            background: #007bff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }
        button:hover {
            background: #0056b3;
        }
        .error {
            color: red;
            margin-bottom: 15px;
            text-align: center;
        }
        h2 {
            text-align: center;
            margin-bottom: 30px;
            color: #333;
        }
        .register-link {
            text-align: center;
            margin-top: 20px;
        }
        .register-link a {
            color: #007bff;
            text-decoration: none;
        }
        .register-link a:hover {
            text-decoration: underline;
        }
        .test-accounts {
            margin-top: 20px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 5px;
            font-size: 12px;
            color: #666;
        }
    </style>
</head>
<body>
<div class="login-container">
    <h2>图书管理系统</h2>
    <% if (request.getAttribute("error") != null) { %>
    <div class="error"><%= request.getAttribute("error") %></div>
    <% } %>
    <form action="login" method="post">
        <div class="form-group">
            <label>用户ID:</label>
            <input type="text" name="userId" required placeholder="请输入用户ID">
        </div>
        <div class="form-group">
            <label>密码:</label>
            <input type="password" name="password" required placeholder="请输入密码">
        </div>
        <button type="submit">登录</button>
    </form>

    <div class="register-link">
        <p>还没有账号？ <a href="register.jsp">立即注册</a></p>
    </div>

    <div class="test-accounts">
        <p><strong>测试账号：</strong></p>
        <p>管理员：1001 / admin123</p>
        <p>普通用户：2001 / 123456</p>
    </div>
</div>
</body>
</html>